package megrez.keycloak.providers.mqtt;

import java.util.Collections;
import java.util.Map;

import org.keycloak.Config.Scope;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.KeycloakSessionFactory;

/**
 * mqtt 日志实现
 * 
 * @author Lucky Yang
 * @since 2.6.9
 */
public class LoggerMqttProviderFactory implements MqttProviderFactory {
    private LoggerMqttService singleton = new LoggerMqttService();

    @Override
    public Map<String, String> getOperationalInfo() {
        return Collections.emptyMap();
    }

    @Override
    public MqttService create(KeycloakSession session) {
        return singleton;
    }

    @Override
    public void init(Scope config) {
        // 不需要实现
    }

    @Override
    public void postInit(KeycloakSessionFactory factory) {
        // 不需要实现
    }

    @Override
    public void close() {
        // 不需要实现
    }

    @Override
    public String getId() {
        return "logger";
    }

}
